package com.csun.cmny.provider.service;

import com.csun.cmny.base.dto.LoginAuthDto;
import com.csun.cmny.core.support.IService;
import com.csun.cmny.provider.model.domain.DmcAppSleepDataRecord;
import com.csun.cmny.provider.model.domain.DmcAppSleepRangeRecord;
import com.csun.cmny.provider.model.dto.app.AppSleepDateQueryDto;
import com.csun.cmny.provider.model.vo.app.AppAlertCountVo;
import com.csun.cmny.provider.model.vo.app.AppCountSleepDataVo;
import com.csun.cmny.provider.model.vo.app.AppDataCompareVo;
import com.csun.cmny.provider.model.vo.app.AppSleepDataRecordVo;

import java.util.List;

public interface DmcAppSleepDataRecordService extends IService<DmcAppSleepDataRecord> {

    /**
     * 保存单日睡眠数据
     * @param: [deviceId, date]
     * @return: java.lang.Integer
     */
    Integer saveAppSingleDaySleepData(Long deviceId , String date);

    /**
     * 根据设备id和日期查询当日睡眠数据
     * @param: [appSleepDateQueryDto]
     * @return: java.util.List<com.csun.cmny.provider.model.domain.DmcAppSleepRangeRecord>
     */
    AppCountSleepDataVo getSleepDataByDeviceIdAndDate(AppSleepDateQueryDto appSleepDateQueryDto);

    /**
     * 根据设备id和起止时间查询睡眠数据
     * @param: [appSleepDateQueryDto]
     * @return: java.util.List<com.csun.cmny.provider.model.domain.DmcAppSleepDataRecord>
     */
    List<AppSleepDataRecordVo> getHistroySleepData(AppSleepDateQueryDto appSleepDateQueryDto);

    /**
     * 统计报警次数
     * @param: [appSleepDateQueryDto, loginAuthDto]
     * @return: com.csun.cmny.provider.model.vo.app.AppAlertCountVo
     */
    AppAlertCountVo getAlertCount(AppSleepDateQueryDto appSleepDateQueryDto, LoginAuthDto loginAuthDto);

    /**
     * 查询本周期和上周期睡眠总时长和平均得分
     * @param: [appSleepDateQueryDto, loginAuthDto]
     * @return: AppDataCompareVo
     */
    AppDataCompareVo getThisCycleDataAndLastCycleData(AppSleepDateQueryDto appSleepDateQueryDto, LoginAuthDto loginAuthDto);
}
